// FlowLayout.h

/*
   Copyright 2006 Corey Tabaka

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

#include <LayoutManager.h>

#ifndef __GUI_FLOWLAYOUT_H__
#define __GUI_FLOWLAYOUT_H__

namespace gui {
	
	class FlowLayout : public LayoutManager {
		protected:
		
		int align;
		int hgap;
		int vgap;
		
		void moveComponents(RefContainer target, int x, int y, int width,
			int height, int rowStart, int rowEnd, bool ltr);
		
		public:
		
		enum {
			LEFT=0,
			CENTER=1,
			RIGHT=2,
			LEADING=3,
			TRAILING=4,
		} ALIGN;
		
		FlowLayout(void);
		FlowLayout(int align);
		FlowLayout(int align, int hgap, int vgap);
		virtual ~FlowLayout(void);
		
		virtual Dimension getPreferredLayoutSize(RefContainer c);
		virtual Dimension getMinimumLayoutSize(RefContainer c);
		
		virtual void setAlignment(int a);
		
		virtual void layoutContainer(RefContainer c);
	};
	
} // namespace gui

#endif
